/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.braveo.dict.db;

import com.braveo.common.BraveException;
import com.braveo.dict.db.jaxb.BraveDictEntryDaoImpl;
import java.io.File;

/**
 *
 * @author jeff.huang
 */
public class BraveDictEntryDaoManager {
    private static BraveDictEntryDaoManager manager = new BraveDictEntryDaoManager();

    private String daoName = "jaxb";

    private BraveDictEntryDaoManager(){

    }

    public static BraveDictEntryDaoManager getManager(){
        return manager;
    }

    public BraveDictEntryDao getDao(File file) {
        if(daoName.equals("jaxb"))
            return new BraveDictEntryDaoImpl(file);
        else
            throw new BraveException(new IllegalArgumentException("Unkown daoName : " + daoName));
    }

    public void setDaoName(String daoId){
        daoName = daoId;
    }

}
